<extend name="Public/base" />
<block name="body">
    <link rel="stylesheet" type="text/css" href="__ZUI__/lib/datetimepicker/datetimepicker.css" media="all">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>考勤统计</h2>
    </div>
    <div class="clearfix">
        <div class="col-xs-10">
            <!-- <eq name="sort" value="normal">
                <a class="btn btn-success" href="{:U('addImpl')}">新增</a>

                <button class="btn ajax-post btn-primary" url="{:U('setStatus',array('method'=>'resume','model'=>'core_lift'))}" target-form="ids">激活
            </button>

                <button class="btn ajax-post btn-warning" url="{:U('setStatus',array('method'=>'forbid','model'=>'core_lift'))}" target-form="ids">禁用
            </button>

                <button class="btn ajax-post btn-danger" url="{:U('setStatus',array('method'=>'delete','model'=>'core_lift'))}" target-form="ids">删除
            </button> -->
<!-- 
                <a class="btn" href="{:U('index',array('sort'=>'recycle'))}">回收站</a> -->

                <else/>
              <!--   <button class="btn ajax-post btn-info" url="{:U('setStatus',array('method'=>'recover','model'=>'core_lift'))}" target-form="ids">恢复
            </button>
 -->
               <!--  <button class="btn ajax-post btn-danger" url="{:U('setStatus',array('method'=>'destory','model'=>'core_lift'))}" target-form="ids">彻底删除
            </button>
 -->
                <!-- <a class="btn" href="{:U()}">正常模式</a> -->
            </eq>

            <button class="btn ajax-post btn-info" onclick="javascript:alert('统计出{$totalCount}条')">统计条数
                
            </button>
        </div>

        <!-- 高级搜索 -->
        <div class="search-form  col-xs-2 text-right">
            <div class="input-group">
                <input type="text" name="keyword" class="search-input form-control" value="{:I('keyword')}" placeholder="请输入姓名">
                <span class="input-group-btn">  <a class="btn btn-default" href="javascript:;" id="search" url="{:U('index')}"><i class="icon-search"></i></a></span>
            </div>
        </div>

    </div>

    <div class="tab-wrap with-padding">
        <div class="form-group">
            <form action="{:U()}" method="post">
                <div class="col-sm-3">
                    <h4>幼儿园：</h4>
                    <select name="unit" class="form-control select">
                            <option value="0">请选择</option>
                            <volist name="unit" id="vo">
                                <option value="{$vo.id}">{$vo.title}</option>
                            </volist>
                    </select>

                    <h4>老师：</h4>
                    <select name="uid" class="form-control select">
                            <option value="0">请选择</option>
                            <volist name="uid" id="vo">
                                <option value="{$vo.uid}">{$vo.nickname}</option>
                            </volist>
                    </select>

                    <h4>班级：</h4>
                    <select name="class_id" class="form-control select">
                            <option value="0">请选择</option>
                            <volist name="class_id" id="vo">
                                <option value="{$vo.id}">{$vo.title}</option>
                            </volist>
                    </select>
                </div>

                <div style="clear:both;"></div>
                <h4>按创建时间统计（开始时间 — 结束时间）：</h4>
                <div class="form-group">
                    <div class="col-sm-3">
                        <input type="text" class="form-control form-datetime form-control " placeholder="选择或者输入一个日期+时间：yyyy-MM-dd hh:mm" name="start" value="2017-01-01 00:00" readonly="">
                    </div>

                    <div style="float:left;line-height: 32px;color: #A9A7A7;"> —— </div>

                    <div class="col-sm-3">
                        <input type="text" class="form-control form-datetime form-control " placeholder="选择或者输入一个日期+时间：yyyy-MM-dd hh:mm" name="end" value="2017-12-31 00:00" readonly="">
                    </div>

                </div>


                <div style="clear:both;"></div>

                <div class="form-group" style="    padding: 20px 10px;">
                    <input type="submit" value="查询" class="btn submit-btn">
                </div>
            </form>
        </div>
    </div>

    <div class="tab-wrap with-padding">
        <div class="panel">
            <div class="panel-body ">
                <h5>{$statustitle}</h5> 总计：{$totalCount}
                <h6></h6>
            </div>
        </div>
    </div>

    <!-- 数据列表 -->
    <div class="data-table with-padding">
        <h5>以下为详细数据：</h5>
            <table class="table table-bordered table-striped ">
                <thead>
                <tr>
                    <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
                    <th class="">单位id</th>
                    <th class="">用户id</th>
                    <th class="">班级id</th>
                    <th class="">应到人数</th>
                    <th class="">缺勤人数</th>
                    <th class="">日期</th>
                    <!-- <th class="">操作</th> -->
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                        <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}"/></td>
                        <td>{$vo.unit}</td>
                        <td>{$vo.uid}</td>
                        <td>{$vo.class_id}</td>
                        <td>{$vo.due_num}</td>
                        <td>{$vo.miss_num}</td>
                        <td>{$vo.create_time|time_format}</td>
                        <!-- <td>
                               <a class="status status_1" href="{:U('editType',array('id'=>$vo[id]))}">编辑</a>
                               <if condition="$vo.status neq 1">
                               <a class="status status_2 ajax-get" href="{:U('setStatus',array('method'=>'resume',id=>$vo[id],'model'=>'core_attendance'))}">激活</a>
                               </if>
                               <if condition="$vo.status neq 2">
                               <a class="status status_4 ajax-get" href="{:U('setStatus',array('method'=>'forbid',id=>$vo[id],'model'=>'core_attendance'))}">禁用</a>
                               </if>
                               <a class="status status_4 ajax-get" href="{:U('setStatus',array('method'=>'delete',id=>$vo[id],'model'=>'core_attendance'))}">删除</a>
                           </td> -->
                       </tr>
                   </volist>
                   <else/>
                   <td colspan="10" class="text-center">{:L('_ADMIN_USER_EMPTY_')}</td>
               </notempty>
               </tbody>
           </table>
       </div>
    <div class="with-padding">
        {$page}
    </div>
</block>

<block name="script">
    <script src="__CSS__/status.css"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script src="__CSS__/status.css"></script>
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript" src="__STATIC__/qtip/jquery.qtip.min.js"></script>
    <script src="__ZUI__/lib/datetimepicker/datetimepicker.js"></script>

    <script type="text/javascript">
        // 选择时日期
        $(".form-datetime").datetimepicker({
            language: "zh-CN",
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            showMeridian: 1,
            format: "yyyy-mm-dd hh:ii"
        });
    </script>
    <script type="text/javascript">
        //搜索功能
        $("#search").click(function() {
            var url = $(this).attr('url');
            var query = $('.search-form').find('input').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
            query = query.replace(/^&/g, '');
            if (url.indexOf('?') > 0) {
                url += '&' + query;
            } else {
                url += '?' + query;
            }
            window.location.href = url;
        });
        //回车搜索
        $(".search-input").keyup(function(e) {
            if (e.keyCode === 13) {
                $("#search").click();
                return false;
            }
        });
        //导航高亮
        highlight_subnav("{:U('record')}");
    </script>
</block>
